<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>



<html>
<head>
	<title>合同详细列表管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出产品数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/cg/productExceptional/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
			$("#btnImport").click(function(){
				$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
					bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
			});
		});
		function page(n,s){
			if(n) $("#pageNo").val(n);
			if(s) $("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/cg/productExceptional/list");
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/cg/productExceptional/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/cg/productExceptional/import/template">下载模板</a>
		</form>
	</div>
		
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cg/productExceptional/">合同详细订单</a></li>
		 <%-- <shiro:hasPermission name="cg:productExceptional:edit"><li><a href="${ctx}/cg/productExceptional/form">合同详细订单添加</a></li></shiro:hasPermission>  --%>
	</ul>
			 
	<form:form id="searchForm" modelAttribute="productExceptional" action="${ctx}/cg/productExceptional/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<ul class="ul-form">
			<li>
				<label>合同：</label>
				<form:select path="contract" class="input-medium">
					<form:options items="${fns:getContractList()}" itemLabel="name" itemValue="id" htmlEscape="false" />
				</form:select>
			<li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
				<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
				<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>

	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<c:forEach items="${columnList}" var="column">
				<th>${column.name}</th>
				</c:forEach>
				<shiro:hasPermission name="cg:productExceptional:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${productExceptionalList}" var="productExceptional" >
			<tr>
				
				 <c:forEach var="item" items="${productExceptional}">
					<c:choose>
					<c:when test="${item.key != 'id'}">  
						<td>
						${item.value }
						</td>
					</c:when>
					<c:otherwise> 
					  <shiro:hasPermission name="cg:productExceptional:edit">
						<td>
							<!-- 暂时取消更新的能力 -->
	    					<%-- <a href="${ctx}/cg/productExceptional/form?id=${item.value }">修改</a> --%>
	    					 
							<a href="${ctx}/cg/productExceptional/delete?id=${item.value}" onclick="return confirmx('确认要删除该产品详情吗？', this.href)" >删除</a>
						</td>
					  </shiro:hasPermission>  
					</c:otherwise>
					</c:choose>			
				</c:forEach>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>